swap case in python hackerrank solution